pub fn main(){
    let mut v = vec![1,2,3];
    v.push(9);

    println!("{}", v[3]);
    let ele = v.get(4);
    match ele {
        Some(e) => println!("e={}",e),
        None => println!("ele None"),
    }
    v.push(10);
    println!("v[{}]={}",v.len()-1 , v[v.len() - 1]);
    // 遍历
    for elem in &mut v {
        if *elem == 2 {
            *elem = 18;
        }
        print!("elem={} ",elem);
    }
    println!("");
    // 枚举
    enum Cell{
        Text(String),
        Num(i32),
        Bool_(i32),
    }
    let row = vec![
        Cell::Text("jdk1.8".to_string()), Cell::Num(19),Cell::Bool_(1)
        ];
    let ele1 = &row[2];
    if let Cell::Text(a) = ele1{
        println!("is Text type {}",a);
    }else if let Cell::Num(n) = ele1{
        println!("is Num type, {}",n);
    }else{
        println!("donot know type.");
    }



}